package com.smartfarm.domain.state;

import com.smartfarm.domain.equipment.AgriculturalEquipment;
import com.smartfarm.domain.equipment.Seeder;
import com.smartfarm.domain.equipment.Harvester;

/**
 * 工作状态
 */
public class WorkingState implements EquipmentState {
    @Override
    public void handleTask(AgriculturalEquipment equipment) {
        String strategyName = equipment.getPathStrategy().getClass().getSimpleName().replace("PathStrategy", "路径规划策略");
        
        if (equipment instanceof Seeder) {
            System.out.println(equipment.getName() + "正在使用" + strategyName + "进行播种作业");
        } else if (equipment instanceof Harvester) {
            System.out.println(equipment.getName() + "正在使用" + strategyName + "进行收割作业");
        } else {
            System.out.println(equipment.getName() + "正在使用" + strategyName + "执行作业");
        }
    }

    @Override
    public String getStateName() {
        return "工作中";
    }
} 